Skip to content

Conversation

@skoslowski
Copy link
Contributor

This adds a readonly flag to buffer_info objects. I consider this a first draft since it only covers the Buffer Protocol portion. Support for readonly in memoryview, array, ... will follow (as separate PRs)

I wanted to get some feedback on this part first:

  • readonly added as default false parameter to not break things
  • the readonly attribute is inserted at the end - consistent with the constructors, but deviating from the order in Py_Buffer.
  • added a const T* constructor with 'readonly=true' - the same could be done for the others, but may require special casing types like nullptr_t

@nedrebo
Copy link

nedrebo commented Nov 19, 2019

Related #1993

@wjakob wjakob merged commit dc65d66 into pybind:master Nov 24, 2019
@wjakob
Copy link
Member

wjakob commented Nov 24, 2019

Merged now, apologies that this took a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants